/******************************************************************************* 
 * Copyright (C) 2012-2015 Microfountain Technology, Inc. All Rights Reserved. 
 * 
 * Unauthorized copying of this file, via any medium is strictly prohibited.   
 * Proprietary and confidential
 * 
 * Last Modified: 2015-9-17 20:21:56
 ******************************************************************************/
package cn.cmcc.online.smsapi.sdk.constant;

import java.io.File;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Configuration;
import android.util.DisplayMetrics;
import android.util.LruCache;
import android.view.WindowManager;
import cn.cmcc.online.smsapi.sdk.db.entity.SysParamEntityManager;
import cn.cmcc.online.smsapi.sdk.ui.popu.util.ViewUtil;
import cn.cmcc.online.smsapi.sdk.util.FileUtils;
import cn.cmcc.online.smsapi.sdk.util.StringUtils;

/**
 * 常量类
 * 
 * @author Administrator
 */
public class Constant {

    public static final String TAG = "XIAOYUAN";
    public static final int jieruma = 1;
    public static final int phone = 2;

    public static final int TYPE_IDENTIFY = 1;// 识别
    public static final int TYPE_SHOW = 2;// 展现
    public static final int TYPE_ACTION = 3;// 执行
/* SDK-376 mobaohua 20160331 start */
    public static final String ACTION_PARSE = "-2";// 识别成功
/* SDK-376 mobaohua 20160331 end */
    
    public static final int ACTION_SMS = 1;// 发短信
    public static final int ACTION_CALL = 2;// 打电话
    public static final int ACTION_URL = 3;// 打开网址
    public static final int ACTION_MAP = 4;// 打开地图
    public static final int ACTION_PAY_CHONGZHI = 5;// 打开充值支付宝
    public static final int ACTION_PAY_HUANKUAN = 6;// 打开还款支付宝
    public static final int ACTION_OTHER = 7;// 其它服务类型
    public static final int ACTION_COPY_CODE = 8;// 复制验证码
    public static final int ACTION_OPEN_APP = 9;// 打开应用
    public static final int ACTION_DATE_REMIND = 10;// 日程提醒
    public static final int ACTION_WATER_GAS = 11;// 水电煤
    public static final int ACTION_TRAFFIC_ORDER = 12;// 流量订购
    public static final int ACTION_EXPRESS_FLOW = 13;// 物流
    public static final int ACTION_FLIGHT_TREND = 14;// 航班
    public static final int ACTION_INSTALMENT_PLAN = 15;// 分期付款
    public static final int ACTION_TRAIN_STATION = 16;// 列车时刻
    public static final int ACTION_NEAR_SITE = 17;// 附近网点
    public static final int ACTION_LIVE_SERVER = 18;// 生活服务
    public static final int RETRY_TIME = 2;
    
    public static final long MINUTE = 60 * 1000L; // 60秒
    public static final long HOUR = 60 * MINUTE; // 1小时
    public static final long DAY = 24 * HOUR; // 24小时
    
    public static final long jarsubFileUpdatePrio = DAY;// jar包每天更新一次

    public static final long NETQUERYPRIO = 7 * DAY;// 7天才允许网络查一次。
    
    /* SDK-526 huangzhiqiang 20160707 start */
    public static final long FIVE_MINUTES = 5 * MINUTE;
    /* SDK-526 huangzhiqiang 20160707 end */

    public static final String CHANNEL = "CHANNEL";// 渠道
    public static final String PRELOADENABLE = "PRELOADENABLE";// 预加载key
    public static final String SMSLOCATEENABLE = "SMSLOCATEENABLE";// 使用归属地key
    public static final String SMS_LOCATE = "SMS_LOCATE";// 设置当前iccid归属地
    public static final String SIM_ICCID = "SIM_ICCID";
    public static final String ONLINE_UPDATE_SDK = "ONLINE_UPDATE_SDK";// 是否支持
                                                                       // 在线升级sdk
                                                                       // 0:不支持
                                                                       // 1:支持,默认是支持
    public static final String ONLINE_UPDATE_SDK_PERIOD = "ONLINE_UPDATE_SDK_PERIOD";// 在线升级sdk时间周期天为单位,默认是2天检测一次
    public static final String SUPPORT_NETWORK_TYPE = "SUPPORT_NETWORK_TYPE";// 支持网络
                                                                             // 0:不支持
                                                                             // 1:wifi
                                                                             // 2:3g及wifi
    public static final String CUSTOM_PUBLIC_SERVER_URL = "CUSTOM_PUBLIC_SERVER_URL";// 第三方自定义公众号服务地址
    public static final String CUSTOM_LOCATION_SERVER_URL = "CUSTOM_LOCATION_SERVER_URL";// 第三方自定义归属地服务地址
    public static final String CUSTOM_SDK_SERVER_URL = "CUSTOM_SDK_SERVER_URL";// 第三方自定义SDK服务地址
    public static final String CUSTOM_SDK_RES_DOWNLAOD_URL = "CUSTOM_SDK_RES_DOWNLAOD_URL";// 第三方自定义SDK下载地址
    /*SDK-564 hewengao 20160726 start*/
    public static final String CUSTOM_LOGO_DOWN_URL="CUSTOM_LOGO_DOWN_URL";//第三方自定义logo下载地址
    /*SDK-564 hewengao 20160726 end*/
    public static final String OPEN_POPUP_DRAG = "OPEN_POPUP_DRAG";// 是否可以拖动弹窗0:不支持弹窗拖动1:支持弹窗拖动
    public static final String POPUP_BG_TYPE = "POPUP_BG_TYPE";// 0:不要背景或全透明
                                                               // 1:蒙层（超半透明）2:图片背景
    public static final String AUTO_UPDATE_DATA = "AUTO_UPDATE_DATA";// 0:自动更新DATA，1需要手动更新
    public static final String SUPPORT_NETWORK_TYPE_MAJOR = "SUPPORT_NETWORK_TYPE_MAJOR";// 支持网络
                                                                                         // 0:不支持
                                                                                         // 1:wifi
                                                                                         // 2:3g及wifi
                                                                                         // 默认值是2.
    
    public static final String CUSTOM_PUBINFO_SERVER_URL = "CUSTOM_PUBINFO_SERVER_URL";// 第三方自定义公众号服务地址
    /* SDK-537 huangzhiqiang 20160714 start */
    public static final String INIT_MAIN_PROCCESS = "INIT_MAIN_PROCCESS";
    /* SDK-537 huangzhiqiang 20160714 end */

    /* SDK-428 huangzhiqiang 20160614 start */
    public static final String UNIQUE_CODE = "UNIQUE_CODE";
    public static final String LOACTION = "LOACTION";
    public static final String LOACTION_LATITUDE = "lat";
    public static final String LOACTION_LONGITUDE = "lng";
    public static final String LOACTION_TIME = "locationTime";
    public static final String AREA_CODE = "areaCode";
    public static final String DUOQU_EMBED_NUMBER_DIR = "duoqu_embed_number";
//    public static final String DUOQU_NUMBER_LOGO_DIR = "duoqu_number_logo";
    /* SDK-428 huangzhiqiang 20160614 end */
    /*SDK-637 zhaojiangwei 20160929 start*/
    public static final String DUOQU_PUBLIC_LOGO_DIR = "duoqu_publiclogo";
    /*SDK-637 zhaojiangwei 20160929 end*/
    public static final String QUERY_ONLINE = "QUERY_ONLINE";// 是否支持在线查询，0不支持，1是支持。
    public static final String BEFORE_HAND_PARSE_SMS_TIME = "BEFORE_HAND_PARSE_SMS_TIME";
    public static final String HAS_IMPORT_DRAWABLE_DATA = "hasImportDrawableData";// 存在导入的资源配置数据
    public static final String DRAWABLE_VERSION = "DrawableVersion";// sdk参数表资源包版本key
    public static final String MENU_VERSION = "MenuVersion";// sdk参数表菜单数据版本key
    public static final String PUBLIC_LOGO_VERSION = "PublicLogoVersion";// sdk参数表公众号Logo资源版本key
    public static final String ALGORITHM_VERSION_FILE = "duoqu_parse_version.txt";// 算法包版本文件
    public static final String DRAWABLE_VERSION_FILE = "duoqu_drawable_version.txt";// 资源包版本文件
    public static final String MENU_VERSION_FILE = "duoqu_nqsql_version.txt";// 菜单数据版本文件
    public static final String PUBLIC_LOGO_VERSION_FILE = "duoqu_publiclogo_version.txt";// 公众号Logo资源版本文件
    public static final String DOMAIN_WHITE_LIST_FILE_NAME = "duoqu_domain_white_list.txt";
    /*SDK-715 songzhirong 20170105 start*/
    public static final String CONFIG_NOTIFY_TIMEMS = "CONFIG_NOTIFY_TIMEMS";//算法包更新通知的时间间隔
    /*SDK-715 songzhirong 20170105 end*/
    /**
     * 气泡识别失败重新识别短信周期，单位毫秒
     */
    public static final String REPARSE_BUBBLE_CYCLE = "REPARSE_BUBBLE_CYCLE"; // 气泡识别失败重新识别短信周期，MatchCacheManager.handObjData使用
    public static final String COMPARE_PUBNUM_OPERATOR = "COMPARE_PUBNUM_OPERATOR"; // 菜单数据是否比较公众号运营商，测试省份数据时可关闭对比，方便获取省份数据

    public static final int SMS_TYPE_CODE = 1;// 验证码短信类型
    public static final int SMS_TYPE_CALL = 2;// 来去电提醒短信类型

    public static final int SERVICE_TYPE_ENABLE = 1;// 启用服务选择
    public static final int SERVICE_TYPE_DISABLE = 0;// 不启用服务选择

    /**
     * 是否识别非公众号码的验证码 true 识别 false 不识别
     * 
     */
    public static final String KEY_ALLOW_VERCODE_MSG = "ALLOW_VERCODE_MSG";

    /**
     * 换卡识别key true 支持 false 不支持
     */
    public static final String KEY_ALLOW_PERSONAL_MSG = "ALLOW_PERSONAL_MSG";

    public static final String KEY_SDK_PUB_UP_TIME = "LastPublicUpdate";
    
    public static final String KEY_SDK_PUB_ID_UP_TIME = "pubid_update_lasttime";//记录查询pubid时间
    public static final String KEY_SDK_BATCH_PHONE_PUB_ID_UPDATE_TIME = "batch_pubid_update_lasttime";//记录批量查询非空的pubid时间
    public static final String KEY_SDK_BATCH_PHONE_NULL_PUB_ID_UPDATE_TIME = "batch_null_pubid_update_lasttime";//记录批量查询空的pubid时间
    public static final String PUBIDC_ENHANCE = "pubid__enhance";

    public static final String SMARTSMS_ENHANCE = "smartsms_enhance";

    /* SDK-793/yangzhi/2017.06.06---start--- */
    public static final String EXCLUDE_ENHANCE = "exclude_enhance";
    /* SDK-793/yangzhi/2017.06.06---end--- */
    public static final String SCENE_CENSUS_ONLINE = "SCENE_CENSUS_ONLINE"; // 上报方式：0不上报，1.打点数据上传,2.上报情景号.默认是0

    public static final String ONLINE_UPDATE_RES_PERIOD = "ONLINE_UPDATE_RES_PERIOD";// check企业logo更新的周期，单位天，默认是2天

    // 弹窗开关
    public static final String POPUP_SHOW_MASTER = "POPUP_SHOW_MASTER";// 总开关
                                                                       // 0:不弹窗
                                                                       // 1:弹窗
    public static final String POPUP_SHOW_SP = "POPUP_SHOW_SP";// 运营商开关 0:不弹窗
                                                               // 1:弹窗
    public static final String POPUP_SHOW_BANK = "POPUP_SHOW_BANK";// 银行开关 0:不弹窗
                                                                   // 1:弹窗
    public static final String POPUP_SHOW_LIFE = "POPUP_SHOW_LIFE";// 生活开关 0:不弹窗
                                                                   // 1:弹窗
    
    public static final String SMART_DATA_UPDATE_TIME = "SMART_DATA_UPDATE_TIME";//更新算法包数据显示
    public static final String SMART_ALGORITHM_PVER = "SMART_ALGORITHM_PVER";//内嵌算法版本号
    
    public static final long NET_MAX_SIZE = 25 * 1024 * 1024; //网络允许的最大包，25k

    public static final long sceneConfigupdatePrio = 14 * DAY;
    public static final long SceneRuleUpdatePrio = 14 * DAY;
    public static final long postqueryIccidScene = 60 * DAY;
    public static final long FirstpostqueryIccidScene = 14 * DAY;
    public static final long addTaskForTime = 10 * MINUTE;
    public static final long weekTime = 2 * DAY;// 修改为2天
    public static final long week = 7 * DAY;
    
    public static final long addVersionChangeTime = 10 * MINUTE;
    public static long lastVersionChangeTime = 0L;
    
    /*ONEPLUS-1607 songzhirong 20161022 start*/
    public static final long sqlUpdateTimeCyc = 30 * MINUTE;
    public static long lastSqlUpdateTime = 0L;
    
    public static final long emergencyTimeCyc = 10 * MINUTE;
    public static long lastEmergencyUpdateTime = 0L;
    /*ONEPLUS-1607 songzhirong 20161022 end*/


    public static final long month = 30 * DAY;

    public static final long lastTimeUpdateTime = 0L;// 记录上次更新的时间
    @SuppressLint("NewApi")
    public static LruCache<String, Long> checkJarMap = new LruCache<String, Long>(
            100);

    /*ONEPLUS-1607 songzhirong 20161022 start*/
    public static LruCache<String, Long> checkCodeIccidMap = new LruCache<String, Long>(
            100);
    /*ONEPLUS-1607 songzhirong 20161022 end*/

    
    public static final String RSAPRVKEY = "RSAPRVKEY";// 私钥
    public static final String SECRETKEY = "SECRETKEY";// 私钥
    public static final String HTTPTOKEN = "HTTPTOKEN";// 网络token
    public static final String RECOGNIZE_LEVEL = "RECOGNIZE_LEVEL";// 短信识别度1：快速识别
                                                                   // 2：标准识别3：高度识别
                                                                   // 4：完整识别
    
    public static final String NEWHTTPTOKEN = "NEWHTTPTOKEN";// 网络token
    public static final String AESKEY = "AESKEY";// 在线请求时第一次请求token用到的AES算法的私钥key
    public static final String AES_IV = "AES_IV";// 在线请求时第一次请求token用到的AES算法的向量空间
    

    // public static final String version =
    // "20140815";//这个主要是代表xml返回的是不是一个下载链接类型
    // public static final String version = "20150601";// 联想新的配置，联想打包需要使用这个

    public static final String suanfa_version = "20150202";// 采用多个包的方法
    // public static final String suanfa_version = "20150619";//
    // 联想新的配置，联想打包需要使用这个

    public static final String bubble_version = "20151014";// 初始气泡版本号
    public static String current_bubble_version = "";// 当前气泡版本号

    public static final String sdk_version = "201412291953";// sdk版本号,仅用于跟踪版本号
    
    /*HWWATCH-4 songzhirong 20160818 start*/
    public static final String EMPTY_JSON = "{}";
    public static final String FIND_CMD_STATUS = "200";  
    /*HWWATCH-4 songzhirong 20160818 end*/

    public static String PARSE_PATH = null;
    public static String FILE_PATH = null;
    public static Context context = null;

    private static int height = 0;
    private static int width = 0;
    public static boolean popupDefault = false;

    public static boolean Test = false;
    
    public static final String URLS = "url";
	/*SDK-683 zhaojiangwei 20161121 start */
//    public static final String XY_SELF = "XYSELF";
//	public static String self_key = "MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQDQfvMvJo7qaklYMfWBU/9yjwWoFIcWHgb5+AwGw3wo2EVC9pB20eQPRG1/rywb0aTSadwyOuczoyvKBHIA11LwgNnDXVqnFMEg3K/2UoOUi4Ul2Kt6USvDebcgB1862vfqpBBAfFIgalfocGTSsd7qcpPrBk8nRJdaZWY4Rp3WiuHaJttL+Wo0DvbQyypSeTK6XzS5VTJGnbR4W+aL2+R6T0Ff+uSYCO1IBU4famAn1trUdjLA1QsT7rZkSvtrj+XkOmyzQdj8jGqYhnrh1IRbZN2a9wZZdpGllDmiaS6zEyip9bBxzbgkxZWydu9GjHMvtt+HziHRpirRcgzjYg3JAgMBAAECggEBALNwzzOBZ/bwSveQ587K0Et0NFYYdLrgVPjGNvOLQ0yT9ehP9L2On01UgzklNj0rDUPawByq/Vk/0ewoL0XyC/vZqZGuwtqRzjXOOdMx6PTrr0iHVe4L9jJiiu0R6y/oTP6w/RvC45vqaoYuVVfQph35Rr07zNvq+KhgJL3CaQ2/I7hzi1LTXsjQP4UzRKfVpfbhoM4JdCuuYqkOUst0Aw6nzsP/hMmH7c5svSnOWhqTIGioOzq3V9Tg9CL+U4qPiwGSdIQfh9ZSNDaXqAd2LKiWlBM8uNelDYcFDGd77UZRf/gR4PwT0fXaSt6IKda8lalf/azZYBiAqkrYxnHulJECgYEA8yZHlIFk1JwIrEjsj9NlVLmIv/+3OLopqXd6X6DXx2Xr+oLKdZlcXovzJfonpFXKIVPKQ5T2DD7SfS/vmbqdC/LaTZzb7FQxTa793tVDnGaCY8Svtn4/ubQhBx+JSxUDiw7JGoBjrPDa6IJyKzxoc2yy1St5FH99v0PEcTFaGHcCgYEA24PR5cL6wH4fRUJg8jS93CrQNk+CskSad0fl2Tk7a3EJXjrkwtQiXd6bm7UDGgoWenPCvLS6XaKw41U0s1Q8jW8JNIjhuMf44mCzsnAZNhmmx7ZueKqfoJtwdWQQgQuOzCEvH2I5YTsDmYWx+n2cp1bcSTC/PB2GGqPUx76k278CgYEAsLlE02IMeB8Eirvh/FMoViEXjHz+nWNpPnvRXMnZq1qf3g7LuheCNFHBovujbmTQKdLtspsFDjdm44hAvFoPJQ0Yr8pvaeBziUPDzv7wSi+TW5IsKBawmHecfcHlFsYqMhrH/dQNHjhc0xtkgZpBTItXm2oiccyMB8TodWDqW9cCgYEA0UaLBZEtnfafuVffNQozN4NZnW2QHIRq/uz8pGt7yqKpW7yp+1Rirzta/sdDfb/ATl2uelmSk1JXcWP6Kj1UvUHudLdK+u8qyCeJKcTVRE6QQjYae8+u/18xh7kuQtjR+qpoUnNCYP/yHprnYvf+MUsOGHjw2E8NWrh2Uzfd0+ECgYEA3mG2hchu3nj8i5X15agxaDc7q2lZWMvisck+ZJZLJLCHQFQos8LBLRghKGmFfuDwncAzRAGMMSfrGQGQaDZZdI62CjOResHjtdPgtSaGR/+1v7wjRyRJkI60RAXV6IqcZIdmvsZIn0P4yrQTNZHtUUBIWdUhmsOZTlWgMkkqTqU=";
	/*SDK-683 zhaojiangwei 20161121 end */
	// 是否安全验证码（华为）
    public static final String KEY_IS_SAFE_VERIFY_CODE = "isSafeVerifyCode";
    // 华为识别的日程开始时间结束时间JSONArray集合Key
    public static final String KEY_HW_PARSE_TIME = "hwParseTime";

    // 功能权限控制
    public static final byte POWER_TOMAP = 1;// 识别
    public static final byte POWER_TOBUBBLE = 2;// 汽泡导向
    public static final byte POWER_TOWINDOW = 3;// 弹窗
    public static final byte POWER_MENU = 4;// 菜单
    public static final byte POWER_COMPANY_INFO = 5;// 企业资料
    public static final byte POWER_SMS_CLASSIFY = 6;// 短信分类
    public static final byte POWER_SMS_ENTERPRISE = 7;// 企业类短信
    public static final byte POWER_TO_YUNCARD = 8;// 创建云卡片
    public static final byte POWER_TOBUBBLE_VIEW = 9;// 汽泡视图
    public static final byte POWER_TO_REMIND = 10;// 提醒接口
    public static final byte POWER_TOSIMPLEBUBBLE_VIEW = 11;// 简单汽泡视图
    public static final byte POWER_SMS_SPECIAL_VALUE = 12;// 号码、网址、时间识别
    public static final String Delimiter = "__ARR__";

    public static final String APPVERSION = "APPVERSION";
    
    //菜单展现次数
    public static final String MENU_SHOW_TIMES = "show";//进入菜单页面次数
    //功能标记状态
    public static final String RECORD_FUNCTION_STATE = "RECORD_FUNCTION_STATE";
    /* SDK-459/yangzhi/2016.05.26---start--- */
    public static final String PATTERN = "yyyy-MM-dd";
    /* SDK-459/yangzhi/2016.05.26---end--- */
    /*SDK-717 songzhirong 20170109 start*/
    public static final String ISCLEANOLDTOKEN = "isCleanOldToken";
    /*SDK-717 songzhirong 20170109 end*/
    /*SDK-720 songzhirong 20170117 start */
    public static final String IS_FAVORITE = "is_favorite";
    public static final String FAVORITE_TYPE_SMS = "1";
    public static final String IS_MARK = "1";
    /*SDK-720 songzhirong 20170117 end */
    /*SDK-725 songzhirong 20170215 start */
    public static final String ALGORITHM_UPDATE_TIME = "ALGORITHM_UPDATE_TIME";
    public static final String START_SERVICE = "START_SERVICE";
    public static final String CONFIG_UPDATE_CYC = "CONFIG_UPDATE_CYC";
    /*SDK-725 songzhirong 20170215 end */
    /*SDK-728 songzhirong 20170302 start */
    public static final String CONFIG_NOTIFY_FIRST_TIME = "CONFIG_NOTIFY_FIRST_TIME";    
    /*SDK-728 songzhirong 20170302 end */
    public static final String CONFIG_WIFI_CONNET_DOWNLOAD_TIME = "CONFIG_WIFI_CONNET_DOWNLOAD_TIME";
    public static final String CONFIG_MONITOR_WIFI = "CONFIG_MONITOR_WIFI";
    public static final String REGISTOR_ICCID_RECIVER = "REGISTOR_ICCID_RECIVER";
    public static final String CONFIG_APPKEY = "CONFIG_APPKEY";
    /*SDK-758 songzhirong 20170410 start*/
    public static final int JOBID = 1001;
    /*SDK-758 songzhirong 20170410 end*/

    /* RM-1652/yangzhi/2017.06.07---start--- */
    public static final String CUSTOM_FILES_DIR_PATH = "CUSTOM_FILES_DIR_PATH";
    /* RM-1652/yangzhi/2017.06.07---end--- */


    /**
     * 获取图像的宽度
     * 
     * @param context
     * @return
     */
    public static int getWidth(Context context) {
        if (width == 0) {
            intiDisplayScreen(context);
        }
        return width;
    }

    /**
     * 获取图像的宽度
     * 
     * @param context
     * @return
     */
    public static int getHeight(Context context) {
        if (height == 0) {
            intiDisplayScreen(context);
        }
        return height;
    }

    /**
     * 初始化屏幕分辩率
     * 
     * @param context
     */
    public static void intiDisplayScreen(Context context) {
        WindowManager wm = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics outMetrics = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(outMetrics);
        if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
            height = outMetrics.widthPixels;
            width = outMetrics.heightPixels;
        } else {
            height = outMetrics.heightPixels;
            width = outMetrics.widthPixels;
        }

    }

    public static void initContext(Context ctx) {
        context = ctx/*.getApplicationContext()*/;
        android.util.Log.e(TAG, "initContext without application");
        if(context == null){
            context = ctx;
        }
        // 开启任务队列
        // SdkTaskQueue.startTaskQueue();
    }

    public static Context getContext() {
        return context;
    }

    public static String getPath(String dir) {
        String path = "";
        try {
            /* RM-1652/yangzhi/2017.06.07---start--- */
            String customFilesDirPath = SysParamEntityManager.getStringParam(context, Constant.CUSTOM_FILES_DIR_PATH);
            if (StringUtils.isNull(customFilesDirPath)){
                customFilesDirPath = getContext().getFilesDir().getPath();
            }
            path = customFilesDirPath + File.separator + dir
                    + File.separator;
            /* RM-1652/yangzhi/2017.06.07---end--- */
            File dirPath = new File(path);
            if (!dirPath.exists() || dirPath.isFile()) {
                dirPath.mkdirs();
            }
        } catch (Throwable e) {
            // TODO: handle Throwable
        }

        return path;
    }
    /* RM-1652/yangzhi/2017.06.07---start--- */
    public static String getOutDexPath(){
        return getPath("outdex");
    }
    /* RM-1652/yangzhi/2017.06.07---end--- */

    /**
     * 获取算法包目录
     * 
     * @return
     */
    public static String getPARSE_PATH() {
        return getPath("parse");
    }

    /**
     * 获取算法包临时解压目录
     * 
     * @return
     */
    public static String getTempPARSE_PATH() {
        return getPath("parse_temp");
    }
 
    /* SDK-782 huangzhiqiang 20170519 start */
    /**
     * 获取算法包更新文件临时存放目录
     * 
     * @return
     */
    public static String getTempUpdatePath() {
        return getPath("parse_update_temp");
    }
    /* SDK-782 huangzhiqiang 20170519 end */

    /**
     * 获取jar包路径
     * 
     * @return
     */
    public static String getJarPath() {
        return FileUtils.getFilePath(getPARSE_PATH(), "parseUtilMain_", "jar");
    }

    public static String getFilePath() {
        if (FILE_PATH == null) {
            if (getContext() != null) {
                FILE_PATH = getContext().getFilesDir().getPath()
                        + File.separator;
            }
        }
        return FILE_PATH;

    }

    public static String DRAWBLE_PATH = null;

    public static String getDRAWBLE_PATH() {
        if (DRAWBLE_PATH == null) {
            DRAWBLE_PATH = getPath("drawable");
        }
        return DRAWBLE_PATH;

    }

    // 内嵌sql
    public static String INITNQSQL_PATH = null;

    public static String getINITSQL_PATH() {
        if (INITNQSQL_PATH == null) {
            INITNQSQL_PATH = getPath("nqsql");
        }
        return INITNQSQL_PATH;

    }

    public static String getInidb_PATH() {
        return getPARSE_PATH() + "init.sql";
    }

    public static String getNQSQL_PATH() {
        return getINITSQL_PATH() + "menu.sql";
    }

    /* SDK-570 huangzhiqiang 20160802 start */
    public static String getXCode3() {
        return "3737364635393330";
    }
    /* SDK-570 huangzhiqiang 20160802 end */
}
